using System;

namespace EntityKit.Runtime
{
    /// <summary>
    /// 集合绑定属性，用于将多个同类型组件绑定到数组或列表
    /// </summary>
    [AttributeUsage(AttributeTargets.Field)]
    public class CollectionBindAttribute : Attribute
    {
        public string ParentPath { get; }
        public string ChildNamePattern { get; }
        public string SortComparer { get; set; }
        
        public CollectionBindAttribute(string parentPath, string childNamePattern = null) 
        {
            ParentPath = parentPath;
            ChildNamePattern = childNamePattern;
        }
    }
}